#include <cstdio>
#include <cstring>

int head[ 151 ], next[ 150 * 150 * 4 ], node[ 150 * 150 * 4 ], e;
int n, m, s[ 151 ], ans[ 151 ];
bool flag;
bool visit[ 151 ];

void addedge( int u, int v ) { node[ e ] = v; next[ e ] = head[ u ]; head[ u ] = e++; }

void dfs( int p, int step )
{
    int i, v, j;
    if ( flag ) return ;
    for ( i = head[ p ]; i != -1; i = next[ i ] )
    {
        v = node[ i ];
        if ( step == n && v == 1 )
        {
            flag = 1;
            for ( j = 0; j < step; j++ ) ans[ j ] = s[ j ];
            return ;    
        }
        if ( !visit[ v ] )
        {
            visit[ v ] = 1;
            s[ step ] = v;
            dfs( v, step + 1 );
            visit[ v ] = 0;
        }
    }
}

int main( )
{
    int i, u, v;
    while ( scanf("%d%d", &n, &m) != EOF )
    {
        memset( head, -1, sizeof( head ) );
        e = 0;
        for ( i = 0; i < m; i++ )
        {
            scanf("%d%d", &u, &v);
            addedge( u, v );
            addedge( v, u );
        }
        flag = false;
        memset( visit, 0, sizeof( visit ) );
        visit[ 1 ] = 1;
        s[ 0 ] = 1;
        dfs( 1, 1 );
        if ( flag )
        {
            printf("%d", ans[ 0 ]);
            for ( i = 1; i < n; i++ )
                printf(" %d", ans[ i ]);
            puts("");
        }
        else
            puts("no solution");
    }
    return 0;
}
